package org.mfw.obj.list
{
	import mx.collections.ArrayCollection;
	
	import org.mfw.interfaces.obj.list.ICoverList;
	import org.mfw.interfaces.obj.list.IGenresList;
	import org.mfw.interfaces.obj.mob.IGenre;
	import org.mfw.obj.mob.Genre;

	public class GenreList extends MediaListObject implements IGenresList
	{
		public function GenreList(object:Object=null)
		{
			super();
			if (object) {
				this.getGenresFromObject(object);
			}

		}
		
		protected function getGenresFromObject(object:Object):void{
			this._elementArray= new Array();
			if(!object.hasOwnProperty("id")){
				for each (var genreResult:Object in object as ArrayCollection) {
					this._elementArray.push(new Genre(genreResult));				
				}
			} else {
					this._elementArray.push(new Genre(object));
			}
			
		}
		public function getGenreByIndex(index:Number):IGenre
		{
			return super.getElementByIndex(index) as Genre;
		}
		
	
		public function getGenreByName(name:String):IGenre
		{
			return null;
		}
		
	
		public function get currentGenre():IGenre
		{
			return super.currentElement as Genre;
		}
		
	
		public function get nextGenre():IGenre
		{
			return super.nextElement as Genre;
		}
		
		
		public function get prevGenre():IGenre
		{
			return super.prevElement as Genre;
		}
		
		
		public function get lastGenre():IGenre
		{
			return super.lastElement as Genre;
		}
		
		public function get coverList():ICoverList
		{
			return null;
		}
		
	}
}